import http from '@/util/http.js'

// 获取未使用优惠券
export const getUnusedCouponList = function(handler) {
	http({
		url: '/coupon/getUnusedCoupons',
		success: handler
	})
}

// 获取历史优惠券
export const getPastCouponList = function(handler) {
	http({
		url: '/coupon/getPastCoupons',
		success: handler
	})
}

// 获取所有未领取优惠券和优惠券总金额
export const getAllUnacceptedCoupons = function(handler) {
	http({
		url: '/coupon/getAllUnacceptedCoupons',
		success: handler
	})
}

// 领取优惠券
export const acceptCoupon = function(data) {
	http({
		url: '/coupon/acceptCoupon',
		data: data
	})
}